/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.blog.city.checkthedep.managedbeans;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.bean.RequestScoped;
import org.primefaces.model.UploadedFile;

/**
 *
 * @author Breath
 */

@RequestScoped
public class UploadFileController {

    private UploadedFile file;  
  
    /**
     * 
     * @return
     */
    public UploadedFile getFile() {  
        return file;  
    }  
  
    /**
     * 
     * @param file
     */
    public void setFile(UploadedFile file) {  
        this.file = file;  
    }  
  
    /**
     * 
     */
    public void upload() {  
        FacesMessage msg = new FacesMessage("Succesful", file.getFileName() + " is uploaded.");  
        FacesContext.getCurrentInstance().addMessage(null, msg);  
    }  
}
